package com.atguigu.springcloud.service.impl;

import com.atguigu.springcloud.jpa.PaymentJpa;
import com.atguigu.springcloud.entities.Payment;
import com.atguigu.springcloud.mapper.PaymentMapper;
import com.atguigu.springcloud.service.PaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @auther zzyy
 * @create 2020-02-18 10:40
 */
@Service
public class PaymentServiceImpl implements PaymentService {
    @Resource
    private PaymentJpa jpa;
    @Autowired
    private PaymentMapper mapper;

    @Override
    public Payment create(Payment payment){
        return jpa.save(payment);
    }

    @Override
    public Payment getPaymentById(Long id){
        return mapper.selectById(id);
//        return jpa.getOne(id);
    }
}
